	<?php
	session_start();

	if(!isset($_SESSION["roomID"])) {
		die("Error, no room found");
	}
	$roomID = $_SESSION["roomID"];
	
	// The student who needs help
	$studentID = $_POST["studentID"];
	$timestamp = $_POST["timestamp"];
	
	$con = mysql_connect("localhost","root","");
	if (!$con) {
		die('Could not connect: ' . mysql_error());
	}
	mysql_select_db("ciu196", $con);
	
	$sql = "
	UPDATE HelpQueue
	SET receivedHelp = 1
	WHERE roomID = '$roomID' AND studentID = '$studentID' AND timestamp = '$timestamp';"
	
	
	$res = mysql_query($sql,$con);	
	if(!$res) {
		die('Error: couldnt update into the helpqueue' . mysql_error());
	} else {
		echo "Updated";
	}
	
	mysql_close();
?>